<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use DB;

class Product extends Model
{
    protected $guarded = ['id'];
    
                
       
    


    public function cate()
    {
    	return $this->belongsTo(Cate::class);
    }

    


   

    public function imgs()
    {
        return $this->hasMany(ProductImg::class);
    }

    

    
   

    

    public function getSaleTxtAttribute()
    {
        return $this->on_sale?'销售中':'已下架';
    }



    
}
